package com.example.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class IndexController {

    @RequestMapping("/hello")
    public String hello(){
        return "hello,gateway";
    }

    /**
     * 让线程睡眠5秒 触发hystrix
     * @return
     */
    @RequestMapping("/timeout")
    public String timeout(){
        try{
            Thread.sleep(5000);
        }catch (Exception e){
            e.printStackTrace();
        }
        return "请求超时";
    }
}
